package com.kbbywyclient.util;

import com.kbbywyclient.util.customservice.ApiException;

import java.net.ConnectException;
import java.net.SocketTimeoutException;

/**
 * Created by FHW
 * on 2017/3/27
 */

public class HttpExcUtil {
    public static void printError(Throwable e) {
        if (e instanceof ConnectException) {
//            LogUtil.d("无法连接服务器，请检查网络设置");
            ToastUtil.showShort("网络异常，请检查网络设置");
        } else if (e instanceof SocketTimeoutException) {
//            LogUtil.d("服务器连接超时，请稍后再试");
            ToastUtil.showShort("服务器连接超时，请稍后再试");
        } else if (e instanceof ApiException) {
//            LogUtil.d(e.getMessage());
            ToastUtil.showShort(e.getMessage());
        } else {
//            LogUtil.d("网络异常，请检查网络设置");
            ToastUtil.showShort("网络异常，请检查网络设置");
        }
    }
}
